package com.alibaba.dubbo.demo.provider;

import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.demo.DemoService;

public class SPI_Demo_DUBBO {
    public static void main(String[] args) {
        ExtensionLoader<DemoService> objectExtensionLoader =  ExtensionLoader.getExtensionLoader(DemoService.class);
//        DemoService red = objectExtensionLoader.getExtension("red");
//        System.out.println(red.sayHello("red"));

        System.out.println("==================");
//
        /**
         * 这里涉及到DemoService中注入另外一个SPI的接口Car,并且car接口有多个实现类,需要使用   @Adaptive指定注入哪一个
         */
        DemoService black = objectExtensionLoader.getExtension("black");
        System.out.println(black.sayHello("black"));


        /**
         * aop
         */


    }
}
